<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <span>
            <router-link to="/login">登录</router-link>
        </span>
        <span>
            <router-link to="/register">注册</router-link>
        </span>
        <hr />
        <div>
            登录/注册
        </div>

        <router-view></router-view>
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script src="../node_modules/vue-router/dist/vue-router.js"></script>
    <script src="./user/login.js"></script>
    <script src="./user/register.js"></script>
    <script>
        const router = new VueRouter({
            routes: [{
                    path: '/login',
                    component: loginForm
                },
                {
                    path: '/register',
                    component: registerForm
                }
            ]
        });

        var app = new Vue({
            el: '#app',
            components: {
                loginForm,
                registerForm
            },
            router
        })
    </script>
</body>

</html>